package com.keye.model.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.keye.model.dao.UserDao;
import com.keye.model.domain.User;
import com.keye.model.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService{

	@Resource
	private UserDao userDao;
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	
	@Override
	public User findUser(String userName) {
		return userDao.selectByUserName(userName);
	}
	
	@Override
	public int insertUser(User user) {
		try {
			userDao.insert(user);
		} catch (Exception e) {
			System.out.println("异常");
			e.printStackTrace();
		}
		return 0;
	}
}
